using System;
using System.Collections.Generic;
using Data;
using EasyGameTemplate;
using Framework.GamePool;
using Framework.UI;
using MintAnimation.Core;
using UnityEngine;

public class GameCube : GamePoolAbstract
{
    
    protected List<GameCube> _oldCube = new List<GameCube>();

    /// <summary>
    /// 是否光照中
    /// </summary>
    public bool isLight;

    public LightVector CurVector { get; protected set; }

    public GameObjectType CubeType;

    public bool IsActive;

    protected Vector2Int _point;

    public Vector2Int Point
    {
        get => this._point;
        set
        {
            this._point = value;
            this.OnSetPoint();
        }
    }



    protected virtual void OnSetPoint() { }

    /// <summary>
    /// 接收到射线
    /// </summary>
    /// <param name="lightVector"></param>
    public virtual void OnInLight(LightVector lightVector) { }

    /// <summary>
    /// 丢失射线
    /// </summary>
    public virtual void OnCloseLight()
    {
        if (this.isLight)
        {
            this.isLight = false;
            for (int i = 0; i < this._oldCube.Count; i++)
            {
                this._oldCube[i].OnCloseLight();
            }
            this._oldCube.Clear();
        }
    }
}